#pragma once

#include <QtCore/QVector>
#include <QtCore/QString>
#include <QtCore/QUrl>
#include <QtCore/QDataStream>

class Bookmark 
{
public:
	QString m_title;
	QString m_url;
	Bookmark(const QString& title, const QUrl& url)
	: m_title(title), m_url(url.toString()) 
	{}
	Bookmark(const QString& title, const QString& url)
		: m_title(title), m_url(QUrl::fromUserInput(url).toString()) 
	{}
	Bookmark() {}
};

QDataStream &operator<<(QDataStream &, const Bookmark &);
QDataStream &operator>>(QDataStream &, Bookmark &);

class Bookmarks : public QVector<Bookmark>
{
public:
  void remove(const QString& url);
  void save(const QString& fName);
  void load(const QString& fName);
};

